package psi.controllers;

import java.util.ArrayList;
import java.util.List;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Record;

import psi.common.Result;
import psi.services.BizConfigService;
import psi.services.UserService;

public class PSIBaseController extends Controller {
	protected void initVarsForView() {
		setAttr("productionName", new BizConfigService().getProductionName());
		setAttr("loginUserName", new UserService().getLoignUserNameWithOrgFullName());
		setAttr("dtFlag", System.currentTimeMillis());
	}

	protected List<Record> emptyList() {
		return new ArrayList<Record>();
	}

	protected Result bad(String msg) {
		return new Result(false, msg);
	}
}
